﻿/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

//
//  Video Management Variables
//  _____________________________________________

@video-gallery-icon__color: @color-black;
@video-gallery-icon__size: 4rem;
@video-gallery-icon__z-index: @image-gallery-image__z-index + 1;

//
//  Extends
//  _____________________________________________

.abs-video-gallery-icon {
    .lib-icon-font(
    @icon-video__content,
    @_icon-font: @icons-admin__font-name,
    @_icon-font-size: @video-gallery-icon__size,
    @_icon-font-color: @video-gallery-icon__color,
    @_icon-font-color-hover: @video-gallery-icon__color,
    @_icon-font-text-hide: true,
    @_icon-font-display: block
    );

    &:before {
        left: 0;
        margin-top: -@video-gallery-icon__size / 2;
        opacity: .5;
        position: absolute;
        right: 0;
        top: 50%;
        z-index: @video-gallery-icon__z-index;
    }
}

//
//  Video Management
//  _____________________________________________

.image.video-placeholder {
    display: inline-block;
    position: relative;
    text-decoration: none;

    &:before {
        background: url(../Magento_ProductVideo/images/gallery-sprite.png) no-repeat left bottom;
        content: '';
        height: 49px;
        left: 50%;
        margin-left: -24px;
        opacity: 0.7;
        position: absolute;
        top: 18px;
        width: 49px;
        z-index: 1;
    }

    .image-placeholder-text {
        font-weight: 400;
    }
}

.preview_hidden_image_input_button {
    display: none;
}

.video-item {
    .product-image-wrapper {
        &:extend(.abs-video-gallery-icon all);

        &:hover {
            &:before {
                opacity: .3;
            }
        }
    }
}

//  Style slideout panel - Add video
.mage-new-video-dialog {
    form.admin__scope-old {
        float: left;
        width: 65%;
    }

    .video-player-sidebar {
        width: 34.99999%;
        float: left;
    }

    .video-player-container {
        &:extend(.abs-video-gallery-icon all);

        border: 1px solid #e3e3e3;
        height: 20vw;
        margin-bottom: 30px;
        position: relative;
        width: 100%;
    }

    .video-information {
        display: none;
        margin-bottom: 7px;

        &:after {
            content: "";
            visibility: hidden;
            display: block;
            height: 0;
            clear: both;
        }

        label {
            font-family: 'Open Sans', @font-family__sans-serif;
            font-size: @font-size__s + 0.2;
            font-weight: @font-weight__semibold;
            display: block;
            width: 25%;
            float: left;
            text-align: right;
        }

        span {
            font-family: 'Open Sans', @font-family__sans-serif;
            font-size: @font-size__s + 0.2;
            font-weight: @font-weight__light;
            display: block;
            width: 74.9999%;
            float: left;
            padding-left: 20px;
        }
    }

    .product-video {
        width: 100%;
        z-index: 20;
        height: 100%;
        position: relative;
    }

    //  TODO UI: this code must be deleted when video slideout panel will be implemented with ui-components
    .admin__scope-old {
        //  re-arrange checkboxes fields in slideout video panel (base, small image etc)
        .admin__field {
            &.field-role,
            &.field-video_image,
            &.field-video_small_image,
            &.field-video_thumbnail,
            &.field-video_swatch_image,
            &.field-new_video_disabled {
                .admin__field-control {
                    #mix-grid .column(3, @field-grid__columns);
                    float: left;
                    margin-left: 80px;
                    position: relative;

                    input {
                        float: right;
                    }
                }

                .admin__field-label {
                    cursor: pointer;
                    left: 0;
                    margin-left: 26%;
                    padding-left: 45px;
                    position: absolute;
                    width: 250px;

                    &:before {
                        content: none;
                    }

                    span {
                        float: left;
                    }
                }
            }

            &.field-new_video_disabled {
                margin-top: 32px;
            }

            &.field.field-new_video_screenshot {
                margin-bottom: 5px;
            }

            &.field.field-new_video_screenshot_preview {
                margin-bottom: 50px;
            }

            &.field-roleLabel {
                height: 0;

                .admin__field-control {
                    #mix-grid .column(3, @field-grid__columns);
                    float: left;
                    margin-left: 80px;
                    position: relative;

                    .control-value {
                        color: @color-black;
                        float: right;
                        font-family: 'Open Sans', @font-family__sans-serif;
                        font-size: @font-size__s + 0.2;
                        font-weight: @font-weight__semibold;
                        position: relative;
                        right: 50px;
                        top: 21px;
                    }
                }
            }

            label > input[type="checkbox"] {
                margin: -3px 3px 0 0;
                vertical-align: middle;
            }

            input[type="checkbox"] {
                -moz-appearance: none;
                -webkit-appearance: none;
                appearance: none;
                background: #fff;
                border-radius: 2px;
                border: 1px solid #adadad;
                cursor: pointer;
                display: inline-block;
                height: 16px;
                margin: 0 5px 0 0;
                position: relative;
                transition: all 0.1s ease-in;
                vertical-align: middle;
                width: 16px;

                &:focus {
                    border-color: #007bdb;
                    box-shadow: none;
                    outline: 0;
                }

                &[disabled] {
                    background-color: #e9e9e9;
                    border-color: #adadad;
                    opacity: .5;
                }

                &:checked {
                    &:after {
                        color: #514943;
                        content: "\e62d";
                        display: inline-block;
                        font-family: 'Admin Icons';
                        font-size: 11px;
                        font-weight: 400
                        left: 0;
                        line-height: 13px;
                        position: absolute;
                        text-align: center;
                        top: 0;
                        width: 14px;
                    }
                }
            }

            .control {
                > input[type="checkbox"] {
                    padding: 0;
                    width: 16px;
                }
            }
        }
    }
}

.image.video-placeholder > button[data-role="add-video-button"],
.image.video-placeholder > button {
    background: transparent;
    border: 0;
    height: 100%;
    position: relative;
    width: 100%;
    z-index: 10;
}

.add-video-button-container {
    float: right;
}

.image-upload-error {
    background: #F9E1E1;
    color: @color-gray19;
    font-size: 12px;
    font-weight: 400;
    padding: 7px 7px 7px 35px;
    position: relative;

    .image-upload-error-cross {
        height: 20px;
        left: 8px;
        position: absolute;
        top: 9px;
        width: 20px;

        &:before,
        &:after {
            background-color: @color-red9;
            content: ' ';
            height: 20px;
            left: 8px;
            position: absolute;
            width: 4px;
        }

        &:before {
            transform: rotate(45deg);
        }

        &:after {
            transform: rotate(-45deg);
        }
    }
}
